<?php

use yii\helpers\Html;
use yii\widgets\DetailView;
use yii\grid\GridView;


/* @var $this yii\web\View */
/* @var $model app\models\Company */

$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => $parkName, 'url' => ['/backend/park/view','id' => $model->park_id]];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="company-view">

    <h1><?= Html::encode($this->title) ?></h1>

    <?= Html::a('新增作物', ['create','id'=>$model->park_id], ['class' => 'btn btn-success']) ?>

    <?= \yii\grid\GridView::widget([
        'dataProvider' => $dataProvider,
        //'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'code',
            'name',
            [
                'attribute' => 'start_time',
                'label'=>'初产时间',
                'value'=>
                    function($model){
                        return  date('Y-m-d',$model->start_time);
                    },
                'headerOptions' => ['width' => '170'],
            ],
            'comment',

            ['class' => 'yii\grid\ActionColumn',
                'controller'=>'crop'
            ],
        ],
    ]); ?>

</div>
